'''
 * Licensed to the Apache Software Foundation (ASF) under one
 * or more contributor license agreements.  See the NOTICE file
 * distributed with this work for additional information
 * regarding copyright ownership.  The ASF licenses this file
 * to you under the Apache License, Version 2.0 (the
 * "License") you may not use this file except in compliance
 * with the License.  You may obtain a copy of the License at
 *
 *     http:#www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
'''


#import org.apache.jena.graph.FrontsTriple;

'''
 * An RDF Statement.
 *
 * <p>A Statement is not a Resource, but can produce a ReifiedStatement
 * that represents it and from which the Statement can be recovered.</p>
 *
 * <p>A statement instance tracks which model created it, if any. All the
 * Resource components of a Statement are in the same model as the
 * Statement, if it has one, and are in no model if the Statement isn't.</p>
 *
 * <p>This interface provides methods supporting typed literals.  This means
 * that methods are provided which will translate a built in type, or an
 * object to an RDF Literal.  This translation is done by invoking the
 * <CODE>toString()</CODE> method of the object, or its built in equivalent.
 * The reverse translation is also supported.  This is built in for built
 * in types.  Factory objects, provided by the application, are used
 * for application objects.</p>
'''

from abc import ABC, abstractmethod

# FrontsTriple
class Statement(ABC):

    '''
     * determine whether two statements are equal.
     *
     * <p> Two statements are considered to be equal if they have the
     * the same subject, predicate and object.  A statement can
     * only be equal to another statement object.
     * </p>
     *
     * @param o the object to be compared
     * @return true if and only if the equality condition is met.
    '''

    #@Override
    # param Object o
    # result boolean
    @abstractmethod
    def equals(self, o):
        pass

    '''
     * Returns asTriple().hashCode()
    '''
    #@Override
    # param 
    # result int
    @abstractmethod
    def hashCode(self):
        pass

    '''
     * An accessor method to return the subject of the statements.
     *
     * @return The subject of the statement.
    '''
    # param 
    # result Resource
    @abstractmethod
    def getSubject(self):
        pass

    '''
     * An accessor function to return the predicate of the statement.
     *
     * @return The predicate of the statement.
    '''
    # param 
    # result Property
    @abstractmethod
    def getPredicate(self):
        pass

    '''
     * An accessor funtion to return the object of the statement.
     *
     * @return Return the object of the statement.
    '''
    # param 
    # result RDFNode
    @abstractmethod
    def getObject(self):
        pass

    '''
     * Get a property of the object of the statement.
     *
     * <p>There is an unfortunate ambiguity here.  GetProperty would normally
     * treat the statement as a resource, and return a property about this
     * statement.  This is not what is wanted in most cases, so getProperty
     * on a statement is defined to call getProperty on its object.  If
     * a property of the statement itself is required, getStatementProperty
     * should be used.</p>
     *
     * <p>If the object of the statement is not a resource, an exception is
     * thrown.</p>
     *
     * @param p the property sought
     * @return a statement representing an instance of the required
     * property
    '''
    # param Property p
    # result Statement
    @abstractmethod
    def getProperty(self, p):
        pass

    '''
     * Return a property of this statement.
     *
     * <p>The model associated with this statement is searched for a statement with
     * this statement as subject and the specified property as predicate.  If
     * such a statement is found it is return.  If more than one exists in the
     * model, then it is undefined which is returned.  If no such statement
     * exists, an exception is thrown.</p>
     *
     * @param p the property sought
     * @return a statement representing an instance of the specified
     * property.
    '''
    # param Property p
    # result Statement
    @abstractmethod
    def getStatementProperty(self, p):
        pass

    '''
     * Return the object of the statement.
     *
     * <p>An exception will be thrown if the object is not a resource.</p>
     *
     * @return The Resource which is the object of the statement.
    '''
    # param 
    # result Resource
    @abstractmethod
    def getResource(self):
        pass

    '''
     * Return the object of the statement.
     *
     * <p>An exception will be thrown if the object is not a Literal.</p>
     *
     * @return The Literal which is the object of the statement.
    '''
    # param 
    # result Literal
    @abstractmethod
    def getLiteral(self):
        pass

    '''
     * Return the object of the statement.
     *
     * <p>An exception will be thrown if the object is not a Literal.</p>
     *
     * @return The object of the statement interpreted as a value of
     * the specified type.
    '''
    # param 
    # result boolean
    @abstractmethod
    def getBoolean(self):
        pass

    '''
     * Return the object of the statement.
     *
     * <p>An exception will be thrown if the object is not a Literal.</p>
     *
     * @return The object of the statement interpreted as a value of
     * the specified type.
    '''
    # param 
    # result byte
    @abstractmethod
    def getByte(self):
        pass

    '''
     * Return the object of the statement.
     *
     * <p>An exception will be thrown if the object is not a Literal.</p>
     *
     * @return The object of the statement interpreted as a value of
     * the specified type.
    '''
    # param 
    # result short
    @abstractmethod
    def getShort(self):
        pass

    '''
     * Return the object of the statement.
     *
     * <p>An exception will be thrown if the object is not a Literal.</p>
     *
     * @return The object of the statement interpreted as a value of
     * the specified type.
    '''
    # param 
    # result int
    @abstractmethod
    def getInt(self):
        pass

    '''
     * Return the object of the statement.
     *
     * <p>An exception will be thrown iof the object is not a Literal.</p>
     *
     * @return The object of the statement interpreted as a value of
     * the specified type.
    '''
    # param 
    # result long
    @abstractmethod
    def getLong(self):
        pass

    '''
     * Return the object of the statement.
     *
     * <p>An exception will be thrown if the object is not a Literal.</p>
     *
     * @return The object of the statement interpreted as a value of
     * the specified type.
    '''
    # param 
    # result char
    @abstractmethod
    def getChar(self):
        pass

    '''
     * Return the object of the statement.
     *
     * <p>An exception will be thrown if the object is not a Literal.</p>
     *
     * @return The object of the statement interpreted as a value of
     * the specified type.
    '''
    # param 
    # result float
    @abstractmethod
    def getFloat(self):
        pass

    '''
     * Return the object of the statement.
     *
     * <p>An exception will be thrown if the object is not a Literal.</p>
     *
     * @return The object of the statement interpreted as a value of
     * the specified type.
    '''
    # param 
    # result double
    @abstractmethod
    def getDouble(self):
        pass

    '''
     * Return the object of the statement.
     *
     * <p>An exception will be thrown if the object is not a Literal.</p>
     *
     * @return The object of the statement interpreted as a value of
     * the specified type.
    '''
    # param 
    # result String
    @abstractmethod
    def getString(self):
        pass

    '''
     * Return the object of the statement.
     *
     * <p>An exception will be thrown if the object is not a Resource.</p>
     *
     * @return The object of the statement.
    '''
    #@Deprecated
    # param ResourceF f
    # result Resource
    @abstractmethod
    def getResource(self, f):
        pass

    '''
     * Return the object of the statement.
     *
     * <p>An exception will be thrown if the object is not a Resource.</p>
     *
     * @return The object of the statement interpreted as a value of
     * the specified type.
    '''
    # param 
    # result Bag
    @abstractmethod
    def getBag(self):
        pass

    '''
     * Return the object of the statement.
     *
     * <p>An exception will be thrown if the object is not a Resource.</p>
     *
     * @return The object of the statement interpreted as a value of
     * the specified type.
    '''
    # param 
    # result Alt
    @abstractmethod
    def getAlt(self):
        pass

    '''
     * Return the object of the statement.
     *
     * <p>An exception will be thrown if the object is not a Resource.</p>
     *
     * @return The object of the statement interpreted as a value of
     * the specified type.
    '''
    # param 
    # result Seq
    @abstractmethod
    def getSeq(self):
        pass

    '''
     * Return the object of the statement as an RDF List.
     * <p>An exception will be thrown if the object is not an:@link RDFList.</p>
     *
     * @return The object of the statement interpreted as a value as RDFList.
    '''
    # param 
    # result RDFList
    @abstractmethod
    def getList(self):
        pass

    '''
     * Return the language of the object of the statement.
     *
     * <p>An exception will be thrown if the object is not a Literal.</p>
     *
     * @return the language of the object of the statement
    '''
    # param 
    # result String
    @abstractmethod
    def getLanguage(self):
        pass

    '''
     * Answer true iff the Literal object of this statement is well-formed XML
     * (ie equivalent to getLiteral().isWellFormedXML()). If the object is not
     * a Literal, throw an exception.
     *
     * @deprecated To be removed.
    '''
    #@Deprecated
    # param 
    # result boolean
    @abstractmethod
    def hasWellFormedXML(self):
        pass

    '''
     * Remove this statement (s, p, x) from the model that contains it. Create a
     * new statement (s, p, o'), where o' is the typed literal corresponding to
     * o, add it to the model, and answer it.
    '''
    # param boolean o
    # result Statement
    @abstractmethod
    def changeLiteralObject(self, o):
        pass

    '''
     * Remove this statement (s, p, x) from the model that contains it. Create a
     * new statement (s, p, o'), where o' is the typed literal corresponding to
     * o, add it to the model, and answer it.
    '''
    # param long o
    # result Statement
    @abstractmethod
    def changeLiteralObject(self, o):
        pass

    '''
     * Remove this statement (s, p, x) from the model that contains it. Create a
     * new statement (s, p, o'), where o' is the typed literal corresponding to
     * o, add it to the model, and answer it.
    '''
    # param int o
    # result Statement
    @abstractmethod
    def changeLiteralObject(self, o):
        pass

    '''
     * Remove this statement (s, p, x) from the model that contains it. Create a
     * new statement (s, p, o'), where o' is the typed literal corresponding to
     * o, add it to the model, and answer it.
    '''
    # param char o
    # result Statement
    @abstractmethod
    def changeLiteralObject(self, o):
        pass

    '''
     * Remove this statement (s, p, x) from the model that contains it. Create a
     * new statement (s, p, o'), where o' is the typed literal corresponding to
     * o, add it to the model, and answer it.
    '''
    # param float o
    # result Statement
    @abstractmethod
    def changeLiteralObject(self, o):
        pass

    '''
     * Remove this statement (s, p, x) from the model that contains it. Create a
     * new statement (s, p, o'), where o' is the typed literal corresponding to
     * o, add it to the model, and answer it.
    '''
    # param double o
    # result Statement
    @abstractmethod
    def changeLiteralObject(self, o):
        pass

    '''
     * change the object of the statement (S, P, X) to (S, P, o).
     * <p>The statement with the old value is removed from the model and
     * a new statement with the new value added and returned.</p>
     *
     * @param o The value to be set.
     * @return the new (S, P, o) statement.
    '''
    # param String o
    # result Statement
    @abstractmethod
    def changeObject(self, o):
        pass

    '''
     * change the object of the statement (S, P, X) to (S, P, o).
     * <p>The statement with the old value is removed from the model and
     * a new statement with the new value added and returned.</p>
     *
     * @param o          The value to be set.
     * @param wellFormed true if o is well formed XML
     * @return the new (S, P, o) statement.
     * @deprecated To be removed: Argument 'wellFormed is ignored
    '''
    #@Deprecated
    # param String o, boolean wellFormed
    # result Statement
    @abstractmethod
    def changeObject(self, o, wellFormed):
        pass

    '''
     * change the object of the statement (S, P, X) to (S, P, o).
     * <p>The statement with the old value is removed from the model and
     * a new statement with the new value added.</p>
     *
     * @param o The value to be set.
     * @param l the language of the String
     * @return the new (S, P, o) statement..
    '''
    # param String o, String l
    # result Statement
    @abstractmethod
    def changeObject(self, o, l):
        pass

    '''
     * change the object of the statement (S, P, X) to (S, P, o).
     * <p>The statement with the old value is removed from the model and
     * a new statement with the new value added.</p>
     *
     * @param o The value to be set.
     * @param l the language of the String
     * @return the new (S, P, o) statement.
     * @deprecated To be removed: Argument 'wellFormed is ignored
    '''
    #@Deprecated
    # param String o, String l, boolean wellFormed
    # result Statement
    @abstractmethod
    def changeObject(self, o, l, wellFormed):
        pass
    

    '''
     * change the object of the statement (S, P, X) to (S, P, o).
     * <p>The statement with the old value is removed from the model and
     * a new statement with the new value added.</p>
     *
     * @param o The value to be set
     * @return the new (S, P, o) statement.
    '''
    # param RDFNode o
    # result Statement
    @abstractmethod
    def changeObject(self, o):
        pass

    '''
     * Remove this statement from its associated model.
     *
     * <p>The statement with the same subject, predicate and object as this
     * statement will be removed from the model associated with this
     * statement.</p>
     *
     * @return this statement.
    '''
    # param 
    # result Statement
    @abstractmethod
    def remove(self):
        pass

    '''
     * Determine if this statement is the subject of any statements its associated
     * model.
     *
     * @return true iff this statement is the subject of a statement in the model.
    '''
    # param 
    # result boolean
    @abstractmethod
    def isReified(self):
        pass

    '''
     * answer a ReifiedStatement object that embodies this Statement and
     * is in the same Model (if any).
    '''
    # param 
    # result ReifiedStatement
    @abstractmethod
    def createReifiedStatement(self):
        pass

    '''
     * answer a ReifiedStatement object that embodies this Statement, has
     * the same Model, and has the given <code>uri</code>.
    '''
    # param String uri
    # result ReifiedStatement
    @abstractmethod
    def createReifiedStatement(self, uri):
        pass

    '''
     * answer an iterator which delivers all the reified statements in the model
     * this Statement belongs to that match this Statement.
    '''
    # param 
    # result RSIterator
    @abstractmethod
    def listReifiedStatements(self):
        pass

    '''
     * get the Model this Statement was created in.
    '''
    # param 
    # result Model
    @abstractmethod
    def getModel(self):
        pass

    '''
     * Finds all possible resources which are
     * the reification of this statement, and for each
     * removes all four triples of the reification quad.
    '''
    # param 
    # result void
    @abstractmethod
    def removeReification(self):
        pass

